import threading
from threading import Thread


def loop():
    x = 0
    while True:
        x = x ^ 1
        print(x)


if __name__ == '__main__':
    # t1 = Thread(target=loop)
    # t1.start()
    #
    # t2 = Thread(target=loop)
    # t2.start()
    for i in range(400):
        t1 = Thread(target=loop)
        t1.start()